/*
 * Carlos.java
 *
 * Created on 29 de Junho de 2007, 14:39
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package characters;

import javax.microedition.lcdui.Image;
import javax.microedition.lcdui.game.Sprite;

/**
 *
 * @author JAKE
 */
public class Carlos extends Sprite{
    
    /**
     * The width of the ball's bounding rectangle.
     */
    static int WIDTH = 40;
    
    /**
     * The height of the ball's bounding rectangle.
     */
    private static int HEIGHT = 52;
    
    private int DISP_WIDTH;
    
    private int DISP_HEIGHT;
    
    /**
     * the X coordinate of the cowboy where the cowboy starts
     * the game.
     */
    int X;
    
    /**
     * the Y coordinate of the cowboy when not jumping.
     */
    int Y;
    
    /** Creates a new instance of Carlos */
    public Carlos(int initialX, int initialY, int DISP_WIDTH, int DISP_HEIGHT) throws Exception{
        super(Image.createImage("/characters/images/Carlos.png"), WIDTH, HEIGHT);
        X = initialX;
        Y = initialY;
        this.DISP_WIDTH = DISP_WIDTH;
        this.DISP_HEIGHT = DISP_HEIGHT;
        defineReferencePixel(WIDTH/2, 0);
        setRefPixelPosition(X, Y);
        
    }
    
    private void keepOnBoundaries(){
        
        
        if(Y >= DISP_HEIGHT){
            
        }
        if(Y <= 0){
            
        }
        
    }
    
    public void moveRight(){
        if(X < DISP_WIDTH && X > 0){
            X++;
            setRefPixelPosition(X, Y);
        }
    }
    
    public void moveLeft(){
        if(X < DISP_WIDTH && X > 0){
            X--;
            setRefPixelPosition(X, Y);
        }
    }
    
    public static int getHEIGHT() {
        return HEIGHT;
    }
}
